package net.dopan.pigframe.api.fegin;

import net.dopan.pigframe.api.fegin.fallback.MenuServiceFallbackImpl;
import net.dopan.pigframe.config.FeignDisableHystrixConfiguration;
import net.dopan.pigframe.core.interceptor.FeignOauth2RequestInterceptor;
import net.dopan.pigframe.core.model.MenuVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Set;

/**
 * @Package: net.dopan.pigframe.api.fegin
 * @Title: MenuServiceApi
 * @Description: 菜单服务接口
 * @author: 刘宽
 * @date: 2018/9/7 17:15
 */
@FeignClient(name = "userCenter", fallback = MenuServiceFallbackImpl.class, configuration = {FeignDisableHystrixConfiguration.class, FeignOauth2RequestInterceptor.class})
public interface MenuServiceApi {
    /**
     * 通过角色名查询菜单
     *
     * @param role 角色名称
     * @return 菜单列表
     */
    @GetMapping(value = "/menu/findMenuByRole/{role}")
    Set<MenuVO> findMenuByRole(@PathVariable("role") String role);
}
